<template>
    <div>
        <a-list size="small" bordered :data-source="noticeList" style="background-color: white" :grid="{ gutter: 16, xs: 1, sm: 1, md: 1, lg: 2}">
            <div slot="header" style="font-size: 18px;">
                通知公告 <span class="float-right">更多</span>
            </div>
            <a-list-item slot="renderItem" slot-scope="item, index" style="padding-top: 8px;" @click="$router.push('/noticeDetail/' +item.noticeId)">
                {{ item.noticeTitle }}
            </a-list-item>
        </a-list>
    </div>
</template>

<script>
    import { getNotice } from '@/api/notice'
  export default {
    name: "IndexNotice",
    data() {
      return {
        noticeList: [],
      }
    },
    created() {
      getNotice().then(res => {
        this.noticeList = res.rows;
        console.log(res);
      })
    }
  }
</script>

<style scoped>
.float-right {
    float: right;
}
</style>
